//*****************************************
//	Oscar Rodriguez Polo	c) 2007
//
//	UTManager.cpp
//
//	UNITARY TEST Manager for NANOSAT1B
//
//*****************************************

/*
 * $Log: UTManager.cpp,v $
 *
 */

#include <public/ut_manager.h>

#include <public/ut_base.h>
#include <public/stdlib.h>
#include <public/string.h>
#include <public/debug_primitives.h>
#include <public/basic_types.h>

void CUTManager::DoAllTest(void)
{

	CUTBase * aux;
	aux = CUTBase::sp_firstTest;

	int32_t seed = 1245546644;
	srand(seed);

	//DEBUG("%s UNITARY TEST. SEED= %d \n", CONFIG_UT_MANAGER_SWR_TEST_ID, seed);

	while (aux)
	{
		int32_t length;

		aux->ConfigTest();

		length = strlen(aux->mp_ID);

		printf("%s", aux->mp_ID);

		for (; length < 70; length++)
		{
			printf(" ");
		}

		if (aux->DoTest())
		{

			printf(": OK\n");

			printf("%s", aux->mp_ID);

			length = strlen(aux->mp_ID);

			for (; length < 70; length++)
			{
				printf(" ");
			}

			printf(": OK\n");

		}
		else
		{
			printf(": FAIL. seed=%u \n", aux->GetSeed());
		}

		aux = aux->mp_next;
	}

}
